package cn.yanyong.org.basic.base.query;

import lombok.Data;

@Data
public class BaseQuery {
    private Integer pageSize=5;
    private Integer currentPage=1;
    private String keyWord;

    public Integer getStart(){
        return (this.currentPage-1)*this.pageSize;
    }

    public BaseQuery() {
    }

    public BaseQuery(Integer pageSize, Integer currentPage) {
        this.pageSize = pageSize;
        this.currentPage = currentPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    @Override
    public String toString() {
        return "DepartmentQuery{" +
                "pageSize=" + pageSize +
                ", currentPage=" + currentPage +
                '}';
    }
}
